// 冒泡排序
function bubbleSort (arr) {
    for (let i = 0; i < arr.length; i++) {
        for (let n = 0; n < arr.length - i - 1; n++) {
            if (arr[n] > arr[n + 1]) {
                [arr[n], arr[n + 1]] = [arr[n + 1], arr[n]];
            }
        }
    }
}

console.log(bubbleSort([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]));
console.log(bubbleSort([5, 6, 7, 8, 9, 10]));
console.log(bubbleSort([a,b,c,d,e,f,g]));  
console.log(bubbleSort([A，B，C，D]));
